package cn.ekuma.epos.datalogic.define;

import com.openbravo.data.basic.BasicException;
import com.openbravo.data.loader.I_Session;
import com.openbravo.pos.base.I_AppView;
import com.openbravo.pos.base.BeanFactoryApp;
import com.openbravo.pos.base.BeanFactoryException;

import e.odbo.data.dao.DataLogic;
import cn.ekuma.epos.datalogic.I_DataLogicSymmetricds;
import cn.ekuma.epos.datalogic.define.dao.ChannelDAO;
import cn.ekuma.epos.datalogic.define.dao.NodeChannelCtlDAO;
import cn.ekuma.epos.datalogic.define.dao.NodeDAO;
import cn.ekuma.epos.datalogic.define.dao.NodeGroupDAO;
import cn.ekuma.epos.datalogic.define.dao.NodeGroupLinkDAO;
import cn.ekuma.epos.datalogic.define.dao.NodeSecurityDAO;
import cn.ekuma.epos.datalogic.define.dao.RouterDAO;
import cn.ekuma.epos.datalogic.define.dao.TriggerDAO;
import cn.ekuma.epos.datalogic.define.dao.TriggerRouterDAO;

public class DataLogicSymmetricds extends DataLogic implements BeanFactoryApp,I_DataLogicSymmetricds {
	public DataLogicSymmetricds(I_Session s) {
		super(s);
	}

	ChannelDAO channelDAO;
	NodeChannelCtlDAO nodeChannelCtlDAO;
	NodeDAO nodeDAO;
	NodeGroupDAO nodeGroupDAO;
	NodeGroupLinkDAO nodeGroupLinkDAO;
	NodeSecurityDAO nodeSecurityDAO;
	RouterDAO routerDAO;
	TriggerDAO triggerDAO;
	TriggerRouterDAO triggerRouterDAO;
	
	@Override
	public Object getBean() {
		return this;
	}

	@Override
	public void init(I_Session s) {
		channelDAO=new ChannelDAO(s);
		 addDaoToMap(channelDAO);
		 nodeChannelCtlDAO=new NodeChannelCtlDAO(s);
		 addDaoToMap(nodeChannelCtlDAO);
		 nodeDAO=new NodeDAO(s);
		 addDaoToMap(nodeDAO);
		 nodeGroupDAO=new NodeGroupDAO(s);
		 addDaoToMap(nodeGroupDAO);
		 nodeGroupLinkDAO=new NodeGroupLinkDAO(s);
		 addDaoToMap(nodeGroupLinkDAO);
		 nodeSecurityDAO=new NodeSecurityDAO(s);
		 addDaoToMap(nodeSecurityDAO);
		 routerDAO=new RouterDAO(s);
		 addDaoToMap(routerDAO);
		 triggerDAO=new TriggerDAO(s);
		 addDaoToMap(triggerDAO);
		 triggerRouterDAO=new TriggerRouterDAO(s);
		 addDaoToMap(triggerRouterDAO);
	}

	@Override
	public void reloadNode(String nodeId) throws BasicException {
		nodeSecurityDAO.reloadNode(nodeId);
	}

	@Override
	public void init(I_AppView app) throws BeanFactoryException {
	}

	@Override
	public Class transParentClass(Class in) {
		return in;
	}

}
